package com.dl.mall;

import com.dl.mall.mapper.UserMapper;
import com.dl.mall.entity.user.User;
import com.dl.mall.service.user.UserService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import javax.annotation.Resource;
import java.sql.Date;

/**
 * @author DL
 * @create 2022-03-13 17:15
 */
@SpringBootTest
@RunWith(SpringRunner.class)
public class testService {

    @Resource
    UserService userService;

    @Resource
    UserMapper userMapper;

    @Test
    public void queryUserBasicInfo(){

        User user = userService.getUserBasicInfo("2391910340");
        System.out.println("user = " + user);
    }

    @Test
    public void updateUserBasicInfo(){

        User user = new User();
        user.setUserId("2391910340");
        user.setBirthday(new Date(new java.util.Date().getTime()));
        userService.modifyUserBasicInfo(user);
        System.out.println("user = " + user);
    }
}
